<?php if(!empty($components_ad)){foreach($components_ad as $k=>$v){?>
	<?php if($v['type']=='rich_text'){?>
	<!-- 富文本内容区域 -->
	<div class="custom-richtext"><?php echo $v['content'];?></div>
	<?php }elseif($v['type']=='goods'){?>	
	<!-- 商品区域 -->
	<ul class="sc-goods-list pic clearfix size-<?php echo $v['size'];?> ">

	<?php foreach($v['goods'] as $key=>$val){?>
	<?php
	if($v['size']==0){
		$pic_type='big-pic';
	}
	elseif($v['size']==2){
		$pic_type=$key==0?'big-pic':'small-pic';
	}
	elseif($v['size']==1){
		$pic_type='small-pic';
	}
	elseif($v['size']==3){
		$pic_type='';
	}
	?>
	<li class="goods-card goods-list <?php echo $pic_type;?> card">
		<a href="<?php echo url('show','goods',array('id'=>$val['id']));?>" class="link js-goods clearfix" target="_blank" data-goods-id="<?php echo $val['id'];?>" title="<?php echo $val['title'];?>">
		<div class="photo-block">
		<img class="goods-photo js-goods-lazy" data-width="1024" data-height="683" data-src="<?php echo $val['image_url'];?>" />
		</div>
		<div class="info <?php if($v['size']!=3){?>clearfix info-notitle info-price<?php }?>">
		<p class="goods-price goods-price-icon">

		<em><?php echo $val['price'];?></em>
		</p>

		</div>
		<div class="goods-buy btn1 info-notitle"></div>  
		<div class="js-goods-buy buy-response" data-alias="z1etyw0a" data-postage="0" data-buyway="1" data-id="<?php echo $val['id'];?>" data-title="<?php echo $val['title'];?>" data-price="<?php echo $val['price'];?>"></div>   

		</a>
	</li>
	<?php }?>
	</ul>
	<?php }elseif($v['type']=='goods_list'){?>
	<?php
	if($v['size']==0){
		$pic_type='big-pic';
	}
	elseif($v['size']==2){
		$pic_type=$key==0?'big-pic':'small-pic';
	}
	elseif($v['size']==1){
		$pic_type='small-pic';
	}
	elseif($v['size']==3){
		$pic_type='';
	}
	?>
	<!-- 商品列表区域 -->
	<ul class="sc-goods-list pic clearfix size-<?php echo $v['size'];?> ">

	<?php foreach($v['list'] as $key=>$val){?>

	<li class="goods-card goods-list <?php echo $pic_type;?> card">
	<a href="#" class="link js-goods clearfix" target="_blank" data-goods-id="<?php echo $val['id'];?>" title="<?php echo $val['title'];?>">
	<div class="photo-block">
	<img class="goods-photo js-goods-lazy" data-width="1024" data-height="683" data-src="<?php echo $val['image_url'];?>" />
	</div>
	<div class="info clearfix info-notitle info-price">
	<p class="goods-price goods-price-icon">

	<em>￥<?php echo $val['price'];?></em>
	</p>

	</div>
	<div class="goods-buy btn1 info-notitle"></div>  
	<div class="js-goods-buy buy-response" data-alias="<?php echo $val['alias'];?>" data-postage="0" data-buyway="1" data-id="3620839" data-title="<?php echo $val['title'];?>" data-price="<?php echo $val['price'];?>"></div> 

	</a>
	</li>
	<?php }?>
	</ul>
	<?php }elseif($v['type']=='image_ad'){?>

	<!-- 图片广告 -->
	<?php if($v['show_method']==0){?>
		<div class="custom-image-swiper">
			<div class="swiper-container">
				<div class="swiper-wrapper">

					<?php foreach($v['sub_entry'] as $key=>$val){?>
					<div class="swiper-slide">
						<?php if($val['type']=='image_ad_selection'){?>
						<a href="javascript:void(0);" target="_blank">
						<img src="<?php echo $val['image_url'];?>"/>
						</a>
						<?php }?>
					</div>
					<?php }?>

				</div>
			</div>
			<div class="swiper-pagination">
				<span class="swiper-pagination-switch swiper-active-switch"></span>
				<span class="swiper-pagination-switch"></span>
			</div>
		</div>
	<?php } elseif($v['show_method']==1){?>
			<ul class="custom-image clearfix">
				<?php foreach($v['sub_entry'] as $key=>$val){?>
					<li class="<?php if($v['size']==1){?>custom-image-small<?php }?>">
							<img class="js-lazy" data-src="<?php echo $val['image_url'];?>" width="320" height="213"/>
					</li>
				<?php }?>
			</ul>
	<?php }?>
	<?php } elseif($v['type']=='cube2'){?>
	<!--魔方-->
	<table class="custom-cube2-table">
	<tbody>
	<?php echo $v['tableContent'];?>
	</tbody>
	</table>

	<?php }elseif($v['type']=='title'){?>
	<!--标题-->
	<?php if($v['title_template']==0){?>
	<div>
	<div class="custom-title  text-left">
	<h2 class="title"><?php echo $v['title'];?></h2>
	<p class="sub_title"><?php echo $v['sub_title'];?></p>
	</div>
	</div>
	<?php }elseif($v['title_template']==1){?>
	<div class="custom-title-noline">
	<div class="custom-title  text-left wx_template">
	<h2 class="title"><?php echo $v['title'];?></h2>
	<p class="sub_title"><span class="sub_title_date"><?php echo $v['wx_title_date'];?></span><span class="sub_title_author"><?php echo $v['wx_title_author'];?></span><?php if($v['wx_title_link_type']==1){?><a class="sub_title_link" href="<?php echo $v['wx_link_url'];?>"><?php echo $v['wx_title_link'];?></a><?php }?></p>
	</div>
	</div>
	<?php }?>
	<?php }elseif($v['type']=='text_nav'){?>
	<!--文本导航-->
	<ul class="custom-nav clearfix">
	<?php foreach($v['sub_entry'] as $key=>$val){?>
	<?php if($val['type']=='text_nav_selection'){?>
	<li>
	<a class="clearfix" href="<?php echo $val['link_url'];?>" target="_blank">
	<span class="custom-nav-title"><?php echo $val['title'];?></span>
	<i class="pull-right right-arrow"></i>
	</a>
	</li>
	<?php }?>
	<?php }?>
	</ul>
	<?php }elseif($v['type']=='nav'){?>

	<!--图片导航-->

	<ul class="custom-nav-4 clearfix">
	<?php foreach($v['sub_entry'] as $key=>$val){?>
	<?php if($val['type']=='nav_selection'){?>
	<li>
	<a href="<?php echo $val['link_url'];?>">
	<img class="js-lazy" data-src="<?php echo $val['image_url'];?>" src="<?php echo $val['image_thumb_url'];?>" style="display: inline;">
	<span class="title"><?php echo $val['title'];?></span>
	</a>
	</li>
	<?php }?>
	<?php }?>

	</ul>
	<?php }elseif($v['type']=='link'){?>

	<ul class="custom-link clearfix">
	<?php foreach($v['sub_entry'] as $key=>$val){?>
	<li>
	<a class="custom-link-link clearfix" href="<?php echo $val['source_url'];?>" target="_blank">
	<h3 class="title"><?php echo $val['source_title'];?></h3>
	<i class="pull-right right-arrow"></i>
	</a>
	</li>
	<?php }?>
	</ul>

	<?php }elseif($v['type']=='search'){?>
	<!--搜索-->
	<div class="custom-search">
		<form action="http://wap.bidcms.com/v2/showcase/goods/search" method="GET">
			<input type="search" class="custom-search-input" placeholder="商品搜索：请输入商品关键字" name="q" value="">
			<input type="hidden" name="bid_id" value="<?php echo $GLOBALS['bidcms_store_id'];?>">
			<button type="submit" class="custom-search-button">搜索</button>
		</form>
	</div>
	<?php }elseif($v['type']=='showcase'){?>
	<!--橱窗-->
	<div class="custom-showcase-wrap custom-showcase-wrap-0">
	<div class="custom-showcase-wrap-title"><?php echo $v['title'];?></div>

	<div class="custom-showcase-body">
	<ul class="custom-showcase clearfix">
	<?php foreach($v['sub_entry'] as $key=>$val){?>
	<li class="<?php if($key==0 && $v['mode']==0){?>custom-showcase-big<?php }else{?>custom-showcase-small<?php }?>">
	<a href="<?php echo $val['link_url'];?>">
	<img class="js-lazy" data-src="<?php echo $val['image_url'];?>" src="<?php echo $val['image_thumb_url'];?>" style="display: inline;">
	</a>
	</li>
	<?php }?>
	</ul>
	<div class="custom-showcase-body-title text-center"><?php echo $v['body_title'];?></div>
	<p class="custom-showcase-body-desc text-center"><?php echo $v['body_desc'];?></p>
	</div>
	</div>
	<?php }elseif($v['type']=='line'){?>
	<!--辅助线-->
	<div class="custom-line-wrap">
		<hr class="custom-line">
	</div>
	<?php }elseif($v['type']=='white'){?>
	<!--空白-->
	<div class="custom-white" style="height: <?php echo $v['height']>0?$v['height']:10;?>px;"></div>

	<?php }elseif($v['type']=='tag_list'){?>
	<!--商品标签-->
	<div class="custom-tag-list clearfix">
			<div class="custom-tag-list-menu-block" style="height: 399px;">
				<ul class="custom-tag-list-side-menu" style="position: static;">
						<?php foreach($v['sub_entry'] as $key=>$val){?>
						<li class="<?php echo $key==0?'current':'';?>">
							<a href="#anchor-<?php echo $val['timestamp'];?>-<?php echo $val['id'];?>">
								<span><?php echo $val['title'];?></span>
							</a>
						</li>
						<?php }?>
						</ul>
			</div>
			
			<div class="custom-tag-list-goods">
					<?php foreach($v['sub_entry'] as $key=>$val){?>
					<p class="custom-tag-list-title" id="anchor-<?php echo $val['timestamp'];?>-<?php echo $val['id'];?>"><?php echo $val['title'];?></p>
					<ul class="custom-tag-list-goods-list">
					<?php foreach($val['list'] as $kgoods=>$vgoods){?>
					   <li class="custom-tag-list-single-goods clearfix">
									<a href="http://wap.bidcms.com/v2/showcase/goods?alias=z1etyw0a" class="custom-tag-list-goods-img">
										<img class="js-lazy" data-src="<?php echo $vgoods['image_url'];?>" alt="" src="<?php echo $vgoods['image_url'];?>" style="display: inline;">
									</a>
									<div class="custom-tag-list-goods-detail">
										<a href="http://wap.bidcms.com/v2/showcase/goods?alias=z1etyw0a" class="custom-tag-list-goods-title"><?php echo $vgoods['title'];?></a>
										<span class="custom-tag-list-goods-price">￥<?php echo $vgoods['price'];?></span>
										<a class="custom-tag-list-goods-buy" href="javascript:void(0)" data-buyway="1" data-alias="z1etyw0a" data-postage="0" data-id="<?php echo $vgoods['id'];?>">
											<span class="ajax-buy">购买</span>
											<span class="ajax-loading"></span>
											<span class="ajax-error">请重试</span>
										</a>
									</div>
								</li>
						<?php }?>
				   </ul>
				   <?php }?>
			</div>
		</div>
	<?php }?>
<?php }}?>